home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / GFXFX2.ZIP / VIEWSCI2.PAS < prev    next >
Pascal/Delphi Source File  |  1995-02-14  |  956b  |  41 lines

  1.  
  2. program viewsci; { VIEWSCI2.PAS }
  3. { Display raw picture in standard mode 13h (320x200x256), by Bas van Gaalen }
  4. uses dos,u_vga,u_pal,u_kb;
  5. const pal_offset=$000a; pic_offset=$030a;
  6. var p_file:file;
  7.  
  8. procedure error(err:string); begin writeln(#10#13,err); halt(1); end;
  9.  
  10. procedure initfile(filename:pathstr);
  11. begin
  12.   if filename='' then error('Enter raw-picture filename on commandline.');
  13.   assign(p_file,filename);
  14.   {$i-} reset(p_file,1); {$i+}
  15.   if ioresult<>0 then error(fexpand(filename)+' not found.');
  16. end;
  17.  
  18. procedure initrawpal;
  19. var pal:pal_type;
  20. begin
  21.   seek(p_file,pal_offset);
  22.   blockread(p_file,pal,$300);
  23.   setvideo($13);
  24.   setpal(pal);
  25. end;
  26.  
  27. procedure displayrawpic;
  28. begin
  29.   seek(p_file,pic_offset);
  30.   blockread(p_file,mem[u_vidseg:0],320*200); { assuming 320x200 }
  31.   close(p_file);
  32. end;
  33.  
  34. begin
  35.   initfile(paramstr(1));
  36.   initrawpal;
  37.   displayrawpic;
  38.   repeat until keypressed;
  39.   setvideo(u_lm);
  40. end.
  41.